import React, { Component } from "react";
import { DatePicker } from "antd";

const { RangePicker } = DatePicker;

class JDatePicker extends Component {
  constructor() {
    super();
  }
  onChange(value, dateString) {
    console.log("Selected Time: ", value);
    console.log("Formatted Selected Time: ", dateString);
  }

  onOk(value) {
    console.log("onOk: ", value);
  }
  render() {
    return (
      <RangePicker
        showTime={{ format: "HH:mm" }}
        format="YYYY-MM-DD HH:mm"
        placeholder={["开始时间", "结束时间"]}
        onChange={this.onChange.bind(this)}
        onOk={this.onOk.bind(this)}
      />
    );
  }
}

export default JDatePicker;
